import request from '@/utils/request'

// 查询车间任务卡列表
export function listTaskcart(query) {
  return request({
    url: '/mes/taskcart/taskCardList',
    method: 'get',
    params: query
  })
}

// 查询车间任务卡详细
export function getTaskcart(taskCardId) {
  return request({
    url: '/mes/taskcart/' + taskCardId,
    method: 'get'
  })
}

// 新增车间任务卡
export function addTaskcart(data) {
  return request({
    url: '/mes/taskcart',
    method: 'post',
    data: data
  })
}

// 修改车间任务卡
export function updateTaskcart(data) {
  return request({
    url: '/mes/taskcart',
    method: 'put',
    data: data
  })
}

// 删除车间任务卡
export function delTaskcart(taskCardId) {
  return request({
    url: '/mes/taskcart/' + taskCardId,
    method: 'delete'
  })
}


//查询对应工序
export function sorted(query) {
  return request({
    url: '/mes/taskcart/sorted',
    method: 'get',
    params: query
  })
}

//报工
export function report(data) {
  return request({
    url: '/mes/taskcart/report',
    method: 'post',
    data: data
  })
}
//任务卡详情
export function getDetail(query) {
  return request({
    url: '/mes/taskcart/getDetail',
    method: 'get',
    params: query
  })
}
//查询工序可报工数量
export function getTransferredQuantity(query) {
  return request({
    url: '/mes/taskcart/getTransferredQuantity',
    method: 'get',
    params: query
  })
}